﻿/* 配表数据管理样式 */

/* 数据行搜索框 */
.data-rows-search-container {
    position: relative;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.data-rows-search-container input {
    padding-right: 35px;
}

.data-rows-search-container .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    pointer-events: none;
}

.data-rows-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.data-row-list-item {
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-row-list-item:hover {
    border-color: #27ae60;
    background: #f0fff4;
}

.data-row-list-item.active {
    border-color: #27ae60;
    background: #e8f8f0;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.data-row-list-item.dragging {
    opacity: 0.5;
    cursor: move;
}

.data-row-list-item.drag-over {
    border-top: 3px solid #3498db;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 5px 0;
    z-index: 10000;
    min-width: 180px;
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-item:hover {
    background: #f0f0f0;
}

.context-menu-item i {
    width: 16px;
    text-align: center;
}

.context-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

.data-row-list-item-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-row-list-item-actions {
    display: flex;
    gap: 5px;
}

.data-row-list-item-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* 数据行编辑器 */
.data-row-editor {
    animation: fadeIn 0.3s;
}

.data-row-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.data-row-editor-header h4 {
    font-size: 16px;
    color: #2c3e50;
    margin: 0;
}

.data-row-name-section {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.data-row-name-section label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 14px;
    cursor: pointer;
    color: #555;
}

.data-row-name-section input[type="checkbox"] {
    margin: 0;
}

.data-row-name-input {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    transition: border-color 0.3s;
}

.data-row-name-input:focus {
    outline: none;
    border-color: #27ae60;
}

.data-row-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 条目字段子项配置 */
/* 字典和条目子字段样式 */
.dict-subfields,
.entry-subfields {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
}

.dict-subfields-header,
.entry-subfields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dict-subfields-header h6,
.entry-subfields-header h6 {
    font-size: 13px;
    color: #495057;
}

.subfield-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.subfield-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.subfield-checkboxes {
    margin: 10px 0;
    padding: 5px 0;
}

.subfield-checkboxes label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

.subfield-checkboxes input[type="checkbox"] {
    margin-right: 5px;
}

/* Schema选择器 */
.schema-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.schema-selector label {
    font-weight: 500;
    color: #34495e;
}

.schema-selector select {
    min-width: 200px;
}

/* 数据编辑器 */
.data-editor {
    margin-top: 20px;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.data-header h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
}

.data-header-actions {
    display: flex;
    gap: 10px;
}



/* 条目类型特殊样式 */
/* 字典容器样式 */
.dict-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.dict-header {
    margin-bottom: 15px;
}

.dict-header label {
    font-weight: 600;
    color: #2c3e50;
}

.dict-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
}

.dict-field-item {
    display: flex;
    flex-direction: column;
}

.dict-field-item label {
    display: block;
    font-size: 13px;
    color: #495057;
    margin-bottom: 5px;
    font-weight: 500;
}

.dict-field-item input,
.dict-field-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* 条目容器样式 */
.entry-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.entry-header label {
    font-weight: 600;
    color: #2c3e50;
}

.entry-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entry-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.entry-item-fields {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.entry-item-field {
    min-width: 0;
}

.entry-item-field label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.entry-item-field input,
.entry-item-field select,
.entry-item-field .color-input-wrapper,
.entry-item-field .flags-input-wrapper,
.entry-item-field .custom-datalist-wrapper {
    width: 100%;
}

.entry-item-field input:not([type="color"]),
.entry-item-field select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.entry-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 22px; /* 对齐标签高度 */
}

.entry-item-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* 列表容器样式（类似条目容器） */
.list-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.list-header label {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-item-value {
    flex: 1;
    min-width: 0;
}

.list-item-value input,
.list-item-value select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.list-item-actions {
    display: flex;
    gap: 5px;
}

.list-item-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* 鱼类预览特殊样式 */
.entry-fish-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.entry-fish-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 数据列表类型样式 */
.datalist-wrapper {
    position: relative;
}

.datalist-wrapper input {
    padding-right: 30px;
}

.datalist-wrapper::after {
    content: '\f0d7';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-large {
    max-width: 95%;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.btn-close,
.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    outline: none;
}

.btn-close:hover,
.close-btn:hover {
    color: #fff;
    background: #e74c3c;
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
}

/* 预览表格容器 */
.preview-scroll-container {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-top-scrollbar {
    overflow-x: auto;
    overflow-y: hidden;
    height: 16px;
    margin-bottom: 10px;
    background: linear-gradient(to bottom, #e8eef3, #f5f7fa);
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.preview-top-scrollbar::-webkit-scrollbar {
    height: 14px;
}

.preview-top-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.preview-top-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 7px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.preview-top-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408b 100%);
    background-clip: padding-box;
}

.preview-top-scrollbar-content {
    height: 1px;
}

.preview-table-wrapper {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 12px;
}

.preview-table thead {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 11px;
}

.preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 11px;
}

.preview-table tbody tr:hover {
    background: #f8f9fa;
}

.preview-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.preview-row-name {
    font-weight: 600;
    color: #2c3e50;
}

.empty-value {
    color: #e74c3c;
    font-weight: 500;
    font-style: italic;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    margin-bottom: 20px;
    color: #7f8c8d;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Lua导出样式 */
.export-options {
    margin-bottom: 20px;
}

.require-list {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    min-height: 50px;
    max-height: 200px;
    overflow-y: auto;
}

.require-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.require-item input {
    flex: 1;
    min-width: 0;
}

.require-item .var-name-input {
    flex: 0 0 120px;
}

.require-item .path-input {
    flex: 2;
}

.require-item .btn-remove {
    flex: 0 0 auto;
}

.code-container {
    background: #282c34;
    border-radius: 6px;
    padding: 20px;
    overflow: auto;
    max-height: 60vh;
}

.lua-code {
    color: #abb2bf;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    white-space: pre;
    overflow-x: auto;
}

/* Lua语法高亮 */
.lua-keyword {
    color: #c678dd;
    font-weight: bold;
}

.lua-string {
    color: #98c379;
}

.lua-number {
    color: #d19a66;
}

.lua-comment {
    color: #5c6370;
    font-style: italic;
}

.lua-function {
    color: #61afef;
}

.lua-operator {
    color: #56b6c2;
}

/* 重复警告 */
.duplicate-warning {
    display: none;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

.duplicate-warning.show {
    display: block;
}

/* 概率显示 */
.probability-display {
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.probability-value {
    font-weight: 600;
    color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .schema-items {
        grid-template-columns: 1fr;
    }

    .split-editor {
        flex-direction: column;
        height: auto;
    }

    .editor-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        max-height: 300px;
    }

    .field-compact-row {
        grid-template-columns: 1fr;
    }

    .data-row-fields {
        grid-template-columns: 1fr;
    }

    .entry-item {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 自定义 Datalist 样式 */
.custom-datalist-wrapper {
    position: relative;
    width: 100%;
}

.custom-datalist-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.custom-datalist-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-datalist-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    margin-top: -1px;
}

.custom-datalist-dropdown.show {
    display: block;
}

.custom-datalist-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.custom-datalist-option:last-child {
    border-bottom: none;
}

.custom-datalist-option:hover {
    background: #f8f9fa;
}

.custom-datalist-option.selected {
    background: #e3f2fd;
    color: #1976d2;
}

.custom-datalist-option.active {
    background: #3498db;
    color: white;
}

.custom-datalist-option-value {
    font-weight: 500;
    color: #2c3e50;
}

.custom-datalist-option-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-left: 8px;
}

.custom-datalist-option.active .custom-datalist-option-value,
.custom-datalist-option.active .custom-datalist-option-label {
    color: white;
}

.custom-datalist-empty {
    padding: 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
}

/* 颜色选择器样式 */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker {
    width: 40px;
    height: 36px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.color-picker:hover {
    border-color: #3498db;
}

.color-text-input {
    flex: 1;
    min-width: 100px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.color-preview {
    width: 36px;
    height: 36px;
    border: 2px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
}

/* 子字段中的颜色选择器（entry, dict, list） */
.entry-item-field .color-input-wrapper,
.dict-field-item .color-input-wrapper,
.list-item .color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.entry-item-field .color-picker,
.dict-field-item .color-picker,
.list-item .color-picker {
    width: 36px;
    height: 32px;
}

.entry-item-field .color-preview,
.dict-field-item .color-preview,
.list-item .color-preview {
    width: 32px;
    height: 32px;
}

/* 预览中的颜色显示 */
.preview-color-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-color-box {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 3px;
    flex-shrink: 0;
}

/* 标志组合输入样式 */
.flags-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.flags-input-wrapper input {
    flex: 1;
    min-width: 80px;
}

.flags-input-wrapper .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 子字段中的 flags 输入 */
.entry-item-field .flags-input-wrapper,
.dict-field-item .flags-input-wrapper,
.list-item .flags-input-wrapper {
    gap: 6px;
}

.entry-item-field .flags-input-wrapper .btn,
.dict-field-item .flags-input-wrapper .btn,
.list-item .flags-input-wrapper .btn {
    padding: 4px 8px;
    font-size: 12px;
}

.flags-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.flags-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.flags-checkbox-item:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.flags-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.flags-checkbox-item span {
    flex: 1;
    font-size: 14px;
    color: #2c3e50;
}

.flags-result {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flags-result label {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.flags-result input {
    flex: 1;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

/* 导入数据模态框 */
.import-preview {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    max-height: 300px;
    overflow: auto;
}

.import-preview h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.import-preview-content {
    font-size: 13px;
    line-height: 1.6;
}

.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.import-preview-table th,
.import-preview-table td {
    padding: 6px 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.import-preview-table th {
    background: #ecf0f1;
    font-weight: 600;
    color: #2c3e50;
}

.import-preview-table td {
    background: white;
}

.import-preview-stats {
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #2e7d32;
}

.import-preview-error {
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #c62828;
}

/* 预览布局 */
.preview-layout {
    display: flex;
    gap: 16px;
    height: calc(80vh - 120px);
    min-height: 500px;
}

.preview-left-panel {
    width: 35%;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e0e0e0;
    padding-right: 16px;
}

.preview-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.preview-section {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.preview-section.preview-original {
    flex: 1;
    min-height: 200px;
}

.preview-section.preview-result {
    flex: 0;
    min-height: 0;
    overflow: hidden;
    transition: flex 0.3s ease;
    display: none;
}

/* 当结果显示时，调整为各占一半 */
.preview-section.preview-result[style*="display: flex"] {
    flex: 1 !important;
    min-height: 200px;
}

.preview-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-bottom: 2px solid #2574a9;
}

.preview-section-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-result .preview-section-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border-bottom: 2px solid #1e8449;
}

/* 脚本执行器样式 */
.script-executor-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
}

.script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.script-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.script-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.script-examples-dropdown {
    position: relative;
}

.script-examples-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.script-examples-menu.show {
    display: block;
}

.example-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.example-item:last-child {
    border-bottom: none;
}

.example-item:hover {
    background: #f8f9fa;
}

.example-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.example-desc {
    font-size: 11px;
    color: #7f8c8d;
}

.script-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: white;
    overflow: hidden;
}

.script-help-text {
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.script-help-text i {
    color: #3498db;
}

.script-syntax-warning {
    font-size: 11px;
    color: #e67e22;
    background: #fef5e7;
    border: 1px solid #f39c12;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: warningPulse 0.3s ease;
}

.script-syntax-warning i {
    color: #f39c12;
    font-size: 12px;
}

@keyframes warningPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.script-input {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    background: #fafafa;
    color: #2c3e50;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* CodeMirror 编辑器容器 */
.script-input-wrapper .CodeMirror {
    flex: 1;
    height: 100% !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.script-input-wrapper .CodeMirror-focused {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.script-input-wrapper .CodeMirror-scroll {
    min-height: 100%;
}

.script-input-wrapper .CodeMirror-gutters {
    background: #2c3e50;
    border-right: none;
}

.script-input-wrapper .CodeMirror-linenumber {
    color: #95a5a6;
}

/* CodeMirror 自动补全提示框样式 */
.CodeMirror-hints {
    position: absolute !important;
    z-index: 10000 !important;
    background: #2c3e50 !important;
    color: #ecf0f1;
    border: 1px solid #34495e !important;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0 !important;
    margin: 0 !important;
}

.CodeMirror-hint {
    padding: 6px 10px !important;
    color: #ecf0f1 !important;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    margin: 0 !important;
    list-style: none !important;
    background: transparent;
}

.CodeMirror-hint:last-child {
    border-bottom: none;
}

.CodeMirror-hint-active,
.CodeMirror-hint:hover {
    background: #3498db !important;
    color: white !important;
}

li.CodeMirror-hint-active {
    background: #3498db !important;
    color: white !important;
}

/* 路径语法高亮 */
.cm-s-monokai .cm-string.cm-property {
    color: #a6e22e !important; /* 明亮的绿色 */
    font-weight: 500;
    text-shadow: 0 0 2px rgba(166, 226, 46, 0.3);
}

.cm-s-monokai .cm-keyword.cm-builtin {
    color: #66d9ef !important; /* 亮青色，用于 update/yield */
    font-weight: bold;
}

.script-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.script-input::placeholder {
    color: #95a5a6;
    font-size: 12px;
}

.result-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
    margin-left: 4px;
}

.script-result-actions {
    display: flex;
    gap: 8px;
}

#apply-modifications-btn {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(52, 152, 219, 0.8);
    }
}

.script-result-content {
    flex: 1;
    overflow-y: auto;
    background: #fafbfc;
    padding: 12px;
}

.preview-container {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.script-result-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #24292e;
    white-space: pre-wrap;
    word-break: break-word;
}

.script-result-item:last-child {
    margin-bottom: 0;
}

.script-result-index {
    display: inline-block;
    min-width: 28px;
    padding: 2px 6px;
    margin-right: 8px;
    background: #27ae60;
    color: white;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.script-result-value {
    color: #0366d6;
}

.script-error {
    padding: 12px;
    background: #fff5f5;
    border-left: 4px solid #e53e3e;
    color: #c53030;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    border-radius: 4px;
}

.script-error-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #e53e3e;
    font-size: 12px;
}

/* 执行错误警告区域 */
.script-execution-errors {
    margin-bottom: 12px;
    background: #fff9e6;
    border: 1px solid #f39c12;
    border-radius: 4px;
    overflow: hidden;
    animation: warningPulse 0.3s ease;
}

.script-execution-errors-title {
    padding: 8px 12px;
    background: #f39c12;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.script-execution-errors-title i {
    font-size: 13px;
}

.script-execution-errors-list {
    padding: 8px 12px;
    max-height: 200px;
    overflow-y: auto;
}

.script-execution-error-item {
    padding: 6px 8px;
    margin-bottom: 4px;
    background: #fff;
    border-left: 3px solid #e67e22;
    border-radius: 2px;
    font-size: 11px;
    color: #555;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
}

.script-execution-error-item:last-child {
    margin-bottom: 0;
}

.script-execution-error-item .error-row-index {
    color: #e67e22;
    font-weight: 600;
    margin-right: 4px;
}

.script-empty-result {
    padding: 30px 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 12px;
}

.script-empty-result i {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 脚本结果表格 */
.script-result-table-wrapper {
    overflow: auto;
    height: 100%;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
}

.script-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: white;
}

.script-result-table thead {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.script-result-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

.script-result-table th:last-child {
    border-right: none;
}

.script-result-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e1e4e8;
    border-right: 1px solid #f0f0f0;
    vertical-align: middle;
}

.script-result-table td:last-child {
    border-right: none;
}

.script-result-table tbody tr:hover {
    background: #f6f8fa;
}

.script-result-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.script-result-table tbody tr:nth-child(even):hover {
    background: #f0f2f5;
}

.result-index-col {
    background: #e8f5e9 !important;
    font-weight: 600;
    color: #27ae60;
    text-align: center !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.script-result-table tbody .result-index-col {
    border-right: 2px solid #c8e6c9;
}

/* 脚本结果值类型样式 */
.list-value {
    color: #2c3e50;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
}

.entry-value,
.dict-value {
    color: #7f8c8d;
    font-style: italic;
    font-size: 11px;
}

.number-value {
    color: #0366d6;
    font-weight: 500;
}

/* 枚举管理面板 */
